package ThisKeyWord;

import javax.sound.midi.SoundbankResource;

/**
 * @author Jimmy
 * @date 2022/11/11 - 17:40
 */
public class Boy {
    private String name;
    private int age;

    public Boy(){

    }

    public Boy(String name) {
        this.name = name;
    }

    public Boy(int age) {
        this.age = age;
    }

    public Boy(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void setName(String name){
        this.name = name;
    }

    public String getName(){
        return name;
    }
    public void setAge(int age){
        this.age = age;
    }
    public int getAge(){
        return age;
    }
    public void marry(Girl girl){
        System.out.println("Marry: " + girl.getName());

    }
    public void shout(){
        if (this.age >= 22){
            System.out.println("Allow to get marry");
        } else {
            System.out.println("Reject");
        }
    }
}
